package priv.pront.code.robot.roboCom_pri_2021.ben;


import java.io.*;
import java.util.HashSet;
import java.util.Set;

/**
 * @Description:
 * @Author: pront
 * @Time:2023-06-28 17:52
 */
public class 懂的都懂 {

    static StreamTokenizer st = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
    static PrintWriter out = new PrintWriter(System.out);
    static double[] b;
    static Set<Double> set;
    static double[] a;
    static int n, m;

    public static void main(String[] args) throws IOException {
        st.nextToken();
        n = (int) st.nval;
        st.nextToken();
        m = (int) st.nval;
        b = new double[n];

        for (int i = 0; i < n; i++) {
            st.nextToken();
            b[i] = st.nval;

        }
        while (m-- > 0) {
            boolean flag = false;
            set = new HashSet<>();
            st.nextToken();
            int len = (int) st.nval;

            a = new double[len];
            for (int i = 0; i < len; i++) {
                st.nextToken();
                a[i] = st.nval;
            }

            for (int i = 0; i < b.length; i++) {
                for (int j = i + 1; j < b.length; j++) {
                    for (int k = j + 1; k < b.length; k++) {
                        for (int l = k + 1; l < b.length; l++) {
                            double sum = (b[i] + b[j] + b[k] + b[l]) / 4.00000000;
                            if (!set.contains(sum)) {
                                set.add(sum);
                            }
                        }
                    }
                }
            }

            for (double i : a) {
                if (!set.contains(i)) {
                    flag = true;
                    out.print("No");
                    out.println();
                    out.flush();
                    break;
                }
            }
            if (!flag) {
                out.print("Yes");
                out.flush();
            }
            if (m != 1) {
                out.println();
            }
        }
        bf.close();
    }
}
